//
//  BKScrollSegmentView.h
//  bestkeep
//
//  Created by utouu666 on 17/2/16.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BKSegmentStyle.h"
#import "BKScrollPageViewDelegate.h"
@class BKSegmentStyle;
@class BKTitleView;

typedef void(^TitleBtnOnClickBlock)(BKTitleView *titleView, NSInteger index);
typedef void(^ExtraBtnOnClick)(UIButton *extraBtn);

@interface BKScrollSegmentView : UIView

// 所有的标题
@property (strong, nonatomic) NSArray *titles;
//所有未选中标题图片
@property(nonatomic,strong)NSArray *pictures;

@property(nonatomic,strong)NSArray *select_pictures;

// 所有标题的设置
@property (strong, nonatomic) BKSegmentStyle *segmentStyle;
@property (copy, nonatomic) ExtraBtnOnClick extraBtnOnClick;
@property (weak, nonatomic) id<BKScrollPageViewDelegate> delegate;
@property (strong, nonatomic) UIImage *backgroundImage;

- (instancetype)initWithFrame:(CGRect )frame segmentStyle:(BKSegmentStyle *)segmentStyle delegate:(id<BKScrollPageViewDelegate>)delegate titles:(NSArray *)titles pictures:(NSArray *)pictures select_pictures:(NSArray *)select_pictures titleDidClick:(TitleBtnOnClickBlock)titleDidClick;


/** 切换下标的时候根据progress同步设置UI*/
- (void)adjustUIWithProgress:(CGFloat)progress oldIndex:(NSInteger)oldIndex currentIndex:(NSInteger)currentIndex;
/** 让选中的标题居中*/
- (void)adjustTitleOffSetToCurrentIndex:(NSInteger)currentIndex;
/** 设置选中的下标*/
- (void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated;
/** 重新刷新标题的内容*/
- (void)reloadTitlesWithNewTitles:(NSArray *)titles;

@end
